package com.adam.springbucks.service;

import com.adam.springbucks.per.entity.Person;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;


/**
 * @ClassName: PersonService
 * @Author Adam
 * @Date 2022/10/29
 * @Description: MybatisPlus查询案例
 */
public interface PersonService {

    Person addPerson(Person person);

    Person findPerson(Long id);

    List<Person> findPersonByIds(List<Long> ids);

    Person setPerson(Person person);

    boolean deletePerson(Long id);

    /**
     * 分页查询
     */
    IPage<Person> findPersonByPagination(Integer current, Integer size);

    /**
     * 自定义SQL; name 和 age 条件查询
     */
    IPage<Person> findPersonByNameOrAge(Page<Person> page, String name, Integer age);

    IPage<Person> findAllPerson(Page<Person> page, String condition);


    Person findPersonByName(String name);



}
